package serverSelction;

import java.util.Random;

public class GenerateServerAvailability {
	
	int k;
	int n;
	public GenerateServerAvailability(int k, int n) {
		super();
		this.k = k;
		this.n = n;
	}
	
	public int[] serverAvailability(){
		int[] serverIndex = new int[n];
		Random random = new Random();
		for (int i = 0; i < n; i++) {
			if (random.nextDouble() < 0.9) {
				serverIndex[i] = 1;
			} else {
				serverIndex[i] = 0;
			}
		}
		return serverIndex;
	}

}
